<template>
	<el-drawer title="招商政策详情" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-form-item label="政策名称" prop="title">{{form.policyName}}
					</el-form-item>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="政策类型" prop="orderCode">{{form.policyTypeName}}
							</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="政策状态" prop="payType">{{form.policyStatusName}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="生效日期" prop="payDay" maxlength="80">{{form.effectTime}}
							</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="政策内容" prop="policyContent">{{form.policyContent}}</el-form-item>
					<el-form-item label="相关附件" v-if="form.attachId!=''">
						<attach-menu :attachIds="form.attachId" :roleFlag="3" :preview="true" ></attach-menu>
					</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {AttachMenu},
	data() {
		return {
			loading: false,
			form: {
				policyName:'',
				policyType:"",
				effectTime: '',
				policyStatus: '',
				policyContent: '',
				attachId:'',
			},
			visible: false,
			isSaveing: false,
			policyTypeList:[{"label":"人才落户","value":1},{"label":"房租减税","value":2},{"label":"装修补贴","value":3},{"label":"税费减免","value":4}]
			,policyStatusList:[{"label":"有效","value":1},{"label":"失效","value":2}]
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(model) {
			this.model = model;
			this.visible = true;
			return this;
		},
		//表单注入数据
		setData(data) {
			this.form = data;
			let policyType = this.policyTypeList.find((item) => item.value === data.policyType);
			this.form.policyTypeName =policyType.label; 
			let policyStatus = this.policyTypeList.find((item) => item.value === data.policyStatus);
			this.form.policyStatusName =policyStatus.label; 

		},
	}
}
</script>
<style>
</style>
